/* 
The NIST RCS (Real-time Control Systems) 
 library is public domain software, however it is preferred
 that the following disclaimers be attached.

Software Copywrite/Warranty Disclaimer

   This software was developed at the National Institute of Standards and
Technology by employees of the Federal Government in the course of their
official duties. Pursuant to title 17 Section 105 of the United States
Code this software is not subject to copyright protection and is in the
public domain. NIST Real-Time Control System software is an experimental
system. NIST assumes no responsibility whatsoever for its use by other
parties, and makes no guarantees, expressed or implied, about its
quality, reliability, or any other characteristic. We would appreciate
acknowledgement if the software is used. This software can be
redistributed and/or modified freely provided that any derivative works
bear some notice that they are derived from it, and any modified
versions bear some notice that they have been modified.



*/ 

/*
*	New C++ File starts here.
*	This file should be named posemath_c_n.c
*/

/* Include all C language NML and CMS function prototypes. */
#include "nmlcms_c.h"

/* Include externally supplied prototypes. */
#include "posemath_c_n.h"

#ifndef MAX_PM_C_NAME_LENGTH
#define MAX_PM_C_NAME_LENGTH 1
#endif
#ifndef PM_C_NAME_LIST_LENGTH
#define PM_C_NAME_LIST_LENGTH 1
#endif


/* This list must be in alphabetical order and the three lists must correspond. */
const char PM_c_name_list[PM_C_NAME_LIST_LENGTH][MAX_PM_C_NAME_LENGTH]= {
	""};
const NMLTYPE PM_c_id_list[PM_C_NAME_LIST_LENGTH]= {
	-1};
const size_t PM_c_size_list[PM_C_NAME_LIST_LENGTH]= {
	0};

/* Enumerated Type Constants */

/*  PM_AXIS */
#ifndef MAX_ENUM_PM_AXIS_STRING_LENGTH
#define MAX_ENUM_PM_AXIS_STRING_LENGTH 5
#endif
#ifndef ENUM_PM_AXIS_LENGTH
#define ENUM_PM_AXIS_LENGTH 4
#endif

const char enum_PM_AXIS_string_list[ENUM_PM_AXIS_LENGTH][MAX_ENUM_PM_AXIS_STRING_LENGTH]= {
	"PM_X", /* 0,0 */
	"PM_Y", /* 1,1 */
	"PM_Z", /* 2,2 */
	""};

const int enum_PM_AXIS_int_list[ENUM_PM_AXIS_LENGTH]= {
	PM_X, /* 0,0 */
	PM_Y, /* 1,1 */
	PM_Z, /* 2,2 */
	};

const char *PM_c_enum_PM_AXIS_symbol_lookup(long v)
{
	switch(v)
	{
		case PM_X: return("PM_X"); /* 0 */
		case PM_Y: return("PM_Y"); /* 1 */
		case PM_Z: return("PM_Z"); /* 2 */
		default:break;
	}
	return(NULL);
}

const struct cms_enum_info enum_PM_AXIS_info_struct={
	"PM_AXIS",
	(const char **)enum_PM_AXIS_string_list,
	enum_PM_AXIS_int_list,
	MAX_ENUM_PM_AXIS_STRING_LENGTH,
	ENUM_PM_AXIS_LENGTH,
	(cms_symbol_lookup_function_t)PM_c_enum_PM_AXIS_symbol_lookup
	};




/*
*	NML/CMS Update function for PM_ROTATION_VECTOR
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PM_ROTATION_VECTOR_update(struct cms_c_struct *cms, nml_PM_ROTATION_VECTOR_c_t *x)
{

	cms_begin_class(cms,"PM_ROTATION_VECTOR",0);
	cms_update_double(cms,"s",&(x->s));
	cms_update_double(cms,"x",&(x->x));
	cms_update_double(cms,"y",&(x->y));
	cms_update_double(cms,"z",&(x->z));

	cms_end_class(cms,"PM_ROTATION_VECTOR",0);

}

/*
*	NML/CMS Update function for PmRotationVector
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PmRotationVector_update(struct cms_c_struct *cms, nml_PmRotationVector_c_t *x)
{

	cms_begin_class(cms,"PmRotationVector",0);
	cms_update_double(cms,"s",&(x->s));
	cms_update_double(cms,"x",&(x->x));
	cms_update_double(cms,"y",&(x->y));
	cms_update_double(cms,"z",&(x->z));

	cms_end_class(cms,"PmRotationVector",0);

}


/*
*	NML/CMS Update function for PM_CIRCLE
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PM_CIRCLE_update(struct cms_c_struct *cms, nml_PM_CIRCLE_c_t *x)
{

	cms_begin_class(cms,"PM_CIRCLE",0);
	cms_begin_class_var(cms,"center");
	cms_PM_CARTESIAN_update(cms, ( nml_PM_CARTESIAN_c_t *) &(x->center));
	cms_end_class_var(cms,"center");
	cms_begin_class_var(cms,"normal");
	cms_PM_CARTESIAN_update(cms, ( nml_PM_CARTESIAN_c_t *) &(x->normal));
	cms_end_class_var(cms,"normal");
	cms_begin_class_var(cms,"rTan");
	cms_PM_CARTESIAN_update(cms, ( nml_PM_CARTESIAN_c_t *) &(x->rTan));
	cms_end_class_var(cms,"rTan");
	cms_begin_class_var(cms,"rPerp");
	cms_PM_CARTESIAN_update(cms, ( nml_PM_CARTESIAN_c_t *) &(x->rPerp));
	cms_end_class_var(cms,"rPerp");
	cms_begin_class_var(cms,"rHelix");
	cms_PM_CARTESIAN_update(cms, ( nml_PM_CARTESIAN_c_t *) &(x->rHelix));
	cms_end_class_var(cms,"rHelix");
	cms_update_double(cms,"radius",&(x->radius));
	cms_update_double(cms,"angle",&(x->angle));
	cms_update_double(cms,"spiral",&(x->spiral));

	cms_end_class(cms,"PM_CIRCLE",0);

}

/*
*	NML/CMS Update function for PM_HOMOGENEOUS
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PM_HOMOGENEOUS_update(struct cms_c_struct *cms, nml_PM_HOMOGENEOUS_c_t *x)
{

	cms_begin_class(cms,"PM_HOMOGENEOUS",0);
	cms_begin_class_var(cms,"tran");
	cms_PM_CARTESIAN_update(cms, ( nml_PM_CARTESIAN_c_t *) &(x->tran));
	cms_end_class_var(cms,"tran");
	cms_begin_class_var(cms,"rot");
	cms_PM_ROTATION_MATRIX_update(cms, ( nml_PM_ROTATION_MATRIX_c_t *) &(x->rot));
	cms_end_class_var(cms,"rot");

	cms_end_class(cms,"PM_HOMOGENEOUS",0);

}


/*
*	NML/CMS Update function for PM_CARTESIAN
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PM_CARTESIAN_update(struct cms_c_struct *cms, nml_PM_CARTESIAN_c_t *x)
{

	cms_begin_class(cms,"PM_CARTESIAN",0);
	cms_update_double(cms,"x",&(x->x));
	cms_update_double(cms,"y",&(x->y));
	cms_update_double(cms,"z",&(x->z));

	cms_end_class(cms,"PM_CARTESIAN",0);

}

/*
*	NML/CMS Update function for PM_CYLINDRICAL
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PM_CYLINDRICAL_update(struct cms_c_struct *cms, nml_PM_CYLINDRICAL_c_t *x)
{

	cms_begin_class(cms,"PM_CYLINDRICAL",0);
	cms_update_double(cms,"theta",&(x->theta));
	cms_update_double(cms,"r",&(x->r));
	cms_update_double(cms,"z",&(x->z));

	cms_end_class(cms,"PM_CYLINDRICAL",0);

}

/*
*	NML/CMS Update function for PmCircle
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PmCircle_update(struct cms_c_struct *cms, nml_PmCircle_c_t *x)
{

	cms_begin_class(cms,"PmCircle",0);
	cms_begin_class_var(cms,"center");
	cms_PmCartesian_update(cms, ( nml_PmCartesian_c_t *) &(x->center));
	cms_end_class_var(cms,"center");
	cms_begin_class_var(cms,"normal");
	cms_PmCartesian_update(cms, ( nml_PmCartesian_c_t *) &(x->normal));
	cms_end_class_var(cms,"normal");
	cms_begin_class_var(cms,"rTan");
	cms_PmCartesian_update(cms, ( nml_PmCartesian_c_t *) &(x->rTan));
	cms_end_class_var(cms,"rTan");
	cms_begin_class_var(cms,"rPerp");
	cms_PmCartesian_update(cms, ( nml_PmCartesian_c_t *) &(x->rPerp));
	cms_end_class_var(cms,"rPerp");
	cms_begin_class_var(cms,"rHelix");
	cms_PmCartesian_update(cms, ( nml_PmCartesian_c_t *) &(x->rHelix));
	cms_end_class_var(cms,"rHelix");
	cms_update_double(cms,"radius",&(x->radius));
	cms_update_double(cms,"angle",&(x->angle));
	cms_update_double(cms,"spiral",&(x->spiral));

	cms_end_class(cms,"PmCircle",0);

}

/*
*	NML/CMS Update function for PM_EULER_ZYZ
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PM_EULER_ZYZ_update(struct cms_c_struct *cms, nml_PM_EULER_ZYZ_c_t *x)
{

	cms_begin_class(cms,"PM_EULER_ZYZ",0);
	cms_update_double(cms,"z",&(x->z));
	cms_update_double(cms,"y",&(x->y));
	cms_update_double(cms,"zp",&(x->zp));

	cms_end_class(cms,"PM_EULER_ZYZ",0);

}


/*
*	NML/CMS Update function for PmEulerZyz
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PmEulerZyz_update(struct cms_c_struct *cms, nml_PmEulerZyz_c_t *x)
{

	cms_begin_class(cms,"PmEulerZyz",0);
	cms_update_double(cms,"z",&(x->z));
	cms_update_double(cms,"y",&(x->y));
	cms_update_double(cms,"zp",&(x->zp));

	cms_end_class(cms,"PmEulerZyz",0);

}


/*
*	NML/CMS Update function for PM_EULER_ZYX
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PM_EULER_ZYX_update(struct cms_c_struct *cms, nml_PM_EULER_ZYX_c_t *x)
{

	cms_begin_class(cms,"PM_EULER_ZYX",0);
	cms_update_double(cms,"z",&(x->z));
	cms_update_double(cms,"y",&(x->y));
	cms_update_double(cms,"x",&(x->x));

	cms_end_class(cms,"PM_EULER_ZYX",0);

}

/*
*	NML/CMS Update function for PmEulerZyx
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PmEulerZyx_update(struct cms_c_struct *cms, nml_PmEulerZyx_c_t *x)
{

	cms_begin_class(cms,"PmEulerZyx",0);
	cms_update_double(cms,"z",&(x->z));
	cms_update_double(cms,"y",&(x->y));
	cms_update_double(cms,"x",&(x->x));

	cms_end_class(cms,"PmEulerZyx",0);

}

/*
*	NML/CMS Update function for PmCartesian
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PmCartesian_update(struct cms_c_struct *cms, nml_PmCartesian_c_t *x)
{

	cms_begin_class(cms,"PmCartesian",0);
	cms_update_double(cms,"x",&(x->x));
	cms_update_double(cms,"y",&(x->y));
	cms_update_double(cms,"z",&(x->z));

	cms_end_class(cms,"PmCartesian",0);

}

/*
*	NML/CMS Update function for PM_QUATERNION
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PM_QUATERNION_update(struct cms_c_struct *cms, nml_PM_QUATERNION_c_t *x)
{

	cms_begin_class(cms,"PM_QUATERNION",0);
	cms_update_double(cms,"s",&(x->s));
	cms_update_double(cms,"x",&(x->x));
	cms_update_double(cms,"y",&(x->y));
	cms_update_double(cms,"z",&(x->z));

	cms_end_class(cms,"PM_QUATERNION",0);

}



/*
*	NML/CMS Update function for PM_LINE
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PM_LINE_update(struct cms_c_struct *cms, nml_PM_LINE_c_t *x)
{

	cms_begin_class(cms,"PM_LINE",0);
	cms_begin_class_var(cms,"start");
	cms_PM_POSE_update(cms, ( nml_PM_POSE_c_t *) &(x->start));
	cms_end_class_var(cms,"start");
	cms_begin_class_var(cms,"end");
	cms_PM_POSE_update(cms, ( nml_PM_POSE_c_t *) &(x->end));
	cms_end_class_var(cms,"end");
	cms_begin_class_var(cms,"uVec");
	cms_PM_CARTESIAN_update(cms, ( nml_PM_CARTESIAN_c_t *) &(x->uVec));
	cms_end_class_var(cms,"uVec");

	cms_end_class(cms,"PM_LINE",0);

}



/*
*	NML/CMS Update function for PmRpy
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PmRpy_update(struct cms_c_struct *cms, nml_PmRpy_c_t *x)
{

	cms_begin_class(cms,"PmRpy",0);
	cms_update_double(cms,"r",&(x->r));
	cms_update_double(cms,"p",&(x->p));
	cms_update_double(cms,"y",&(x->y));

	cms_end_class(cms,"PmRpy",0);

}



/*
*	NML/CMS Update function for PmLine
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PmLine_update(struct cms_c_struct *cms, nml_PmLine_c_t *x)
{

	cms_begin_class(cms,"PmLine",0);
	cms_begin_class_var(cms,"start");
	cms_PmPose_update(cms, ( nml_PmPose_c_t *) &(x->start));
	cms_end_class_var(cms,"start");
	cms_begin_class_var(cms,"end");
	cms_PmPose_update(cms, ( nml_PmPose_c_t *) &(x->end));
	cms_end_class_var(cms,"end");
	cms_begin_class_var(cms,"uVec");
	cms_PmCartesian_update(cms, ( nml_PmCartesian_c_t *) &(x->uVec));
	cms_end_class_var(cms,"uVec");
	cms_begin_class_var(cms,"qVec");
	cms_PmQuaternion_update(cms, ( nml_PmQuaternion_c_t *) &(x->qVec));
	cms_end_class_var(cms,"qVec");
	cms_update_double(cms,"tmag",&(x->tmag));
	cms_update_double(cms,"rmag",&(x->rmag));
	cms_update_int(cms,"tmag_is_greater_than_rmag",&(x->tmag_is_greater_than_rmag));
	cms_update_int(cms,"tmag_zero",&(x->tmag_zero));
	cms_update_int(cms,"rmag_zero",&(x->rmag_zero));

	cms_end_class(cms,"PmLine",0);

}



/*
*	NML/CMS Update function for PM_SPHERICAL
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PM_SPHERICAL_update(struct cms_c_struct *cms, nml_PM_SPHERICAL_c_t *x)
{

	cms_begin_class(cms,"PM_SPHERICAL",0);
	cms_update_double(cms,"theta",&(x->theta));
	cms_update_double(cms,"phi",&(x->phi));
	cms_update_double(cms,"r",&(x->r));

	cms_end_class(cms,"PM_SPHERICAL",0);

}



/*
*	NML/CMS Update function for PM_RPY
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PM_RPY_update(struct cms_c_struct *cms, nml_PM_RPY_c_t *x)
{

	cms_begin_class(cms,"PM_RPY",0);
	cms_update_double(cms,"r",&(x->r));
	cms_update_double(cms,"p",&(x->p));
	cms_update_double(cms,"y",&(x->y));

	cms_end_class(cms,"PM_RPY",0);

}



/*
*	NML/CMS Update function for PM_ROTATION_MATRIX
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PM_ROTATION_MATRIX_update(struct cms_c_struct *cms, nml_PM_ROTATION_MATRIX_c_t *x)
{

	cms_begin_class(cms,"PM_ROTATION_MATRIX",0);
	cms_begin_class_var(cms,"x");
	cms_PM_CARTESIAN_update(cms, ( nml_PM_CARTESIAN_c_t *) &(x->x));
	cms_end_class_var(cms,"x");
	cms_begin_class_var(cms,"y");
	cms_PM_CARTESIAN_update(cms, ( nml_PM_CARTESIAN_c_t *) &(x->y));
	cms_end_class_var(cms,"y");
	cms_begin_class_var(cms,"z");
	cms_PM_CARTESIAN_update(cms, ( nml_PM_CARTESIAN_c_t *) &(x->z));
	cms_end_class_var(cms,"z");

	cms_end_class(cms,"PM_ROTATION_MATRIX",0);

}



/*
*	NML/CMS Update function for PmSpherical
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PmSpherical_update(struct cms_c_struct *cms, nml_PmSpherical_c_t *x)
{

	cms_begin_class(cms,"PmSpherical",0);
	cms_update_double(cms,"theta",&(x->theta));
	cms_update_double(cms,"phi",&(x->phi));
	cms_update_double(cms,"r",&(x->r));

	cms_end_class(cms,"PmSpherical",0);

}



/*
*	NML/CMS Update function for PmQuaternion
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:03 EDT 2004
*/
void cms_PmQuaternion_update(struct cms_c_struct *cms, nml_PmQuaternion_c_t *x)
{

	cms_begin_class(cms,"PmQuaternion",0);
	cms_update_double(cms,"s",&(x->s));
	cms_update_double(cms,"x",&(x->x));
	cms_update_double(cms,"y",&(x->y));
	cms_update_double(cms,"z",&(x->z));

	cms_end_class(cms,"PmQuaternion",0);

}



/*
*	NML/CMS Update function for PM_POSE
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:04 EDT 2004
*/
void cms_PM_POSE_update(struct cms_c_struct *cms, nml_PM_POSE_c_t *x)
{

	cms_begin_class(cms,"PM_POSE",0);
	cms_begin_class_var(cms,"tran");
	cms_PM_CARTESIAN_update(cms, ( nml_PM_CARTESIAN_c_t *) &(x->tran));
	cms_end_class_var(cms,"tran");
	cms_begin_class_var(cms,"rot");
	cms_PM_QUATERNION_update(cms, ( nml_PM_QUATERNION_c_t *) &(x->rot));
	cms_end_class_var(cms,"rot");

	cms_end_class(cms,"PM_POSE",0);

}



/*
*	NML/CMS Update function for PmPose
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:04 EDT 2004
*/
void cms_PmPose_update(struct cms_c_struct *cms, nml_PmPose_c_t *x)
{

	cms_begin_class(cms,"PmPose",0);
	cms_begin_class_var(cms,"tran");
	cms_PmCartesian_update(cms, ( nml_PmCartesian_c_t *) &(x->tran));
	cms_end_class_var(cms,"tran");
	cms_begin_class_var(cms,"rot");
	cms_PmQuaternion_update(cms, ( nml_PmQuaternion_c_t *) &(x->rot));
	cms_end_class_var(cms,"rot");

	cms_end_class(cms,"PmPose",0);

}



/*
*	NML/CMS Update function for PmRotationMatrix
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:04 EDT 2004
*/
void cms_PmRotationMatrix_update(struct cms_c_struct *cms, nml_PmRotationMatrix_c_t *x)
{

	cms_begin_class(cms,"PmRotationMatrix",0);
	cms_begin_class_var(cms,"x");
	cms_PmCartesian_update(cms, ( nml_PmCartesian_c_t *) &(x->x));
	cms_end_class_var(cms,"x");
	cms_begin_class_var(cms,"y");
	cms_PmCartesian_update(cms, ( nml_PmCartesian_c_t *) &(x->y));
	cms_end_class_var(cms,"y");
	cms_begin_class_var(cms,"z");
	cms_PmCartesian_update(cms, ( nml_PmCartesian_c_t *) &(x->z));
	cms_end_class_var(cms,"z");

	cms_end_class(cms,"PmRotationMatrix",0);

}



/*
*	NML/CMS Update function for PmHomogeneous
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:04 EDT 2004
*/
void cms_PmHomogeneous_update(struct cms_c_struct *cms, nml_PmHomogeneous_c_t *x)
{

	cms_begin_class(cms,"PmHomogeneous",0);
	cms_begin_class_var(cms,"tran");
	cms_PmCartesian_update(cms, ( nml_PmCartesian_c_t *) &(x->tran));
	cms_end_class_var(cms,"tran");
	cms_begin_class_var(cms,"rot");
	cms_PmRotationMatrix_update(cms, ( nml_PmRotationMatrix_c_t *) &(x->rot));
	cms_end_class_var(cms,"rot");

	cms_end_class(cms,"PmHomogeneous",0);

}



/*
*	NML/CMS Update function for PmCylindrical
*	Automatically generated by NML CodeGen Java Applet.
*	on Wed Aug 25 13:07:04 EDT 2004
*/
void cms_PmCylindrical_update(struct cms_c_struct *cms, nml_PmCylindrical_c_t *x)
{

	cms_begin_class(cms,"PmCylindrical",0);
	cms_update_double(cms,"theta",&(x->theta));
	cms_update_double(cms,"r",&(x->r));
	cms_update_double(cms,"z",&(x->z));

	cms_end_class(cms,"PmCylindrical",0);

}

